<template>
	<view class="page">
		<view class="head-out" style="width: 100%;height: 30%; background: url('http://49.232.14.51:9000/friend/bg_info.png');background-repeat: no-repeat;background-size: 100% 100%;">
			<view class="head-in">
				<view class="headpic">
					<image class="pic" :src="userInfo.faceImage" mode=""></image>
				</view>
				<view class="nickname">{{userInfo.nickname}}</view>
			</view>
		</view>
		<view class="tail-out">
			<view class="count-box">
				<view class="type" @click="toCircle">
					<view class="title">
						圈子
					</view>
					<view class="count">
						{{circleCount}}
					</view>
				</view>
				<view class="type">
					<view class="title">
						活动
					</view>
					<view class="count">
						{{spaceCount}}
					</view>
				</view>
			</view>
			<view class="honor" v-on:tap="toHonor">
				<view class="honor-title">
					我的爱好
				</view>
				<view class="iconfont icon-ic_r_b" style="color: #797A94;font-size: 20px;"></view>
			</view>
			<view class="about">
				<view>关于</view>
				<view class="version">版本1.5@炎龙科技</view>
			</view>
			<view class="tail-pic">
				<image class="pic-img" src="http://49.232.14.51:9000/friend/mem_banner.png" mode="scaleToFill"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {},
				circleCount: 0,
				spaceCount: 0
			}
		},
		onShow() {
			this.userInfo = this.getGlobalUser("globalUser");
			this.getCircleCount();
			this.getSpaceCount();
		},
		methods: {
			toHonor(){
				uni.navigateTo({
					url: '../honor/honor'
				})
			},
			getCircleCount(){
				this.$apis.getMemCircleCount({memId: this.userInfo.id}).then((res) => {
					this.circleCount = res;
				});
			},
			getSpaceCount(){
				this.$apis.getMemSpaceCount({memId: this.userInfo.id}).then((res) => {
					this.spaceCount = res;
				});
			},
			toCircle(){
				uni.switchTab({
					url: '../../main/main/main'
				})
			}
		}
	}
</script>

<style>
	@import url("./member.css");
	@import url("../../../static/iconfont/iconfont.css");
</style>
